package com.svw.asmpcloud.bean;


import java.io.Serializable;
import java.util.List;

import org.springframework.security.core.userdetails.UserDetails;

/**
 * 纯粹的用户信息，对应数据库
 */
public class User implements Serializable,UserDetails {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    private String username;
    private String password;
    private List<UriSimpleGrantedAuthority> uris;
    @Override
    public List<UriSimpleGrantedAuthority> getAuthorities() {
        return this.uris;
    }
    /**
     * 账号是否未过期
     * @return
     */
    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    /**
     * 账号是否未被锁定
     * @return
     */
    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    /**
     * 用户账号凭证(密码)是否未过期
     * @return
     */
    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    /**
     * 账户是否被启用
     * @return
     */
    @Override
    public boolean isEnabled() {
        return true;
    }
    @Override
    public String getPassword() {
        return this.password;
    }
    @Override
    public String getUsername() {
        return this.username;
    }
    public List<UriSimpleGrantedAuthority> getUris() {
        return uris;
    }
    public void setUris(List<UriSimpleGrantedAuthority> uris) {
        this.uris = uris;
    }
    public void setUsername(String username) {
        this.username = username;
    }
    public void setPassword(String password) {
        this.password = password;
    }
    
}
